//
//  NoticeModel.m
//  Notice
//
//  Created by CPX on 2018/7/10.
//  Copyright © 2018年 CPX. All rights reserved.
//

#import "NoticeModel.h"

/**
 通知Model
 @author yzl
 */
@implementation NoticeModel


+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"notice_id" : @"id"
             };
}


- (BOOL)modelCustomTransformFromDictionary:(NSDictionary *)dic {
    NSString *timestamp = dic[@"create_date"];
    self.create_date = timestamp;
    if ([timestamp isKindOfClass:[NSString class]]){
        NSDate *d = [NSDate dateWithTimeIntervalSince1970:timestamp.floatValue/1000];
        NSDateFormatter *format = [[NSDateFormatter alloc]init];
        
        [format setDateFormat:@"MM/dd HH:mm"];
        self.createDateFormatStr = [format stringFromDate:d];
    }
    return YES;
}

@end
